package com.huikaka.controller;

import com.huikaka.entity.Result;
import com.huikaka.entity.Withdraw;
import com.huikaka.service.WithdrawService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/withdraw")
public class WithdrawController {
    @Autowired
    private WithdrawService withdrawService;

    @RequestMapping("/findAllWithdrawInfoByInviteCode")
    public Result findAllWithdrawInfoByInviteCode(@RequestParam String inviteCode){
        Result result = new Result();
        try {
            List<Withdraw> withdrawList = withdrawService.findAllWithdrawInfoByInviteCode(inviteCode);
            if(withdrawList!=null){
                result.setCode(0);
                result.setMessage("成功");
                result.setData(withdrawList);
                return result;
            }
            result.setCode(1);
            result.setMessage("失败");
        }catch (Exception e){

        }

        return result;
    }

}
